#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1010;
typedef long long ll;
ll s[N], sum;
struct node
{
	int t;
	int xh;
}a[N];

bool  cmp(node x, node y)
{
	return x.t < y.t;
}
int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
	{
		scanf("%d", &a[i].t);
		a[i].xh = i;
	}
	sort(a + 1, a + n + 1, cmp);
	for (int i = 1; i <= n; i++)
	{
		s[i] = s[i - 1] + a[i].t;
		sum += s[i] - a[i].t;
	}
	for (int i = 1; i <= n; i++)
		printf("%d ", a[i].xh);
	printf("\n");
	printf("%.2lf\n", 1.0 * sum / n);
	return 0;
}